package com.zhu.gmallpublisher.mapper;

import com.zhu.gmallpublisher.bean.TrafficKeyWords;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 关键词分分数统计接口
 */
public interface TrafficKeywordsMapper {

    @Select("select keyword,sum(keyword_count * multiIf(source = 'search',10,source = 'order',5,source='cart',2,source='click',1,0)) keyword_score" +
            " from dws_traffic_source_keyword_page_view_window" +
            " group by toYYYYMMDD(stt),keyword order by keyword_score")
    List<TrafficKeyWords> selectKeywords(@Param(value = "date") Integer selectDate);
}
